//
//  CSGXBackButton.m
//  CarSalesMS_GCX
//
//  Created by Ssky on 2016/10/27.
//  Copyright © 2016年 Tony. All rights reserved.
//

#import "CSGXBackButton.h"

@implementation CSGXBackButton

- (void)setupUI {
    //
    self.backgroundColor = kColorBar;
    
    self.gxImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"back"]];
    self.gxTitleLabel = [[UILabel alloc] init];
    
    [self.gxImageView sizeToFit];
//    NSLog(@"%@-%@", @(self.gxImageView.gx_Width), @(self.gxImageView.gx_Height));
    
    [self insertSubview:_gxImageView atIndex:2];
    [self insertSubview:_gxTitleLabel atIndex:3];
    
    [_gxImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self).offset(5);
        make.centerY.equalTo(self);
        make.size.mas_offset(CGSizeMake(17, 27));
    }];
    
    [_gxTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.trailing.equalTo(self);
        make.leading.equalTo(_gxImageView.mas_trailing).offset(2);
    }];
}


- (void)setHighlighted:(BOOL)highlighted { }

@end
